<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        th{text-align: center;}
        .form-group{margin-left:20px;}
    </style>
</block>
<block name="content">


    <div class="newMess">
        <table class="table table-striped table-bordered table-hover table-condensed text-center">
            <tbody>
            <tr >
                <th>供应商名称</th>
                <th>产品名称</th>
                <th>供应商编号</th>
                <th>销售单价</th>
                <th>合作时间</th>
                <th>操作人</th>
                <th>审核状态</th>
                <th>是否上架</th>
                <th>操作</th>
            </tr>
            <!--酒店-->
            <volist name="auditList['hotelList']" id="vo">
                <tr>
                    <td>{$vo.supplier_name}</td>
                    <td>酒店</td>
                    <td>{$vo.supplier_sn}</td>
                    <td>{$vo.room_name}: 儿童价：{$vo.child_actual_cost}元/人<br>成人价：{$vo.adult_actual_cost}元/人 </td>
                    <td>{$vo.start_time|date="Y-m-d",###}至{$vo.end_time|date="Y-m-d",###}</td>
                    <td>{$vo.audit_name}</td>
                    <td>
                        <switch name="vo.is_review">
                            <case value="1">已审核</case>
                            <case value="-1">未审核</case>
                            <case value="-2">已拒绝</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="vo.is_shelves">
                            <case value="1">是</case>
                            <case value="-1">否</case>
                        </switch>
                    </td>
                    <td>
                        <if condition="checkAuth('Shops/hotelProductById')">
                            <a href="{:U('Shops/hotelProductById',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">详情</a>
                        </if>
                    </td>
                </tr>
            </volist>
            <!--景区-->

            <volist name="auditList['scenicList']" id="vo">
                <tr>
                    <td>{$vo.supplier_name}</td>
                    <td>景区</td>
                    <td>{$vo.supplier_sn}</td>
                    <td>{$vo.scenic_name}: 儿童价：{$vo.child_actual_cost}元/人<br>成人价：{$vo.adult_actual_cost}元/人 </td>
                    <td>{$vo.start_time|date="Y-m-d",###}至{$vo.end_time|date="Y-m-d",###}</td>
                    <td>{$vo.audit_name}</td>
                    <td>
                        <switch name="vo.is_review">
                            <case value="1">已审核</case>
                            <case value="-1">未审核</case>
                            <case value="-2">已拒绝</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="vo.is_shelves">
                            <case value="1">是</case>
                            <case value="-1">否</case>
                        </switch>
                    </td>
                    <td>
                        <if condition="checkAuth('Shops/scenicProductById')">
                            <a href="{:U('Shops/scenicProductById',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">详情</a>
                        </if>

                    </td>
                </tr>
            </volist>
            <!--保险-->
            <volist name="auditList['insureList']" id="vo">
                <tr>
                    <td>{$vo.supplier_name}</td>
                    <td>保险</td>
                    <td>{$vo.supplier_sn}</td>
                    <td>{$vo.insure_name}: 儿童价：{$vo.child_actual_cost}元/人<br>成人价：{$vo.adult_actual_cost}元/人 </td>
                    <td>{$vo.start_time|date="Y-m-d",###}至{$vo.end_time|date="Y-m-d",###}</td>
                    <td>{$vo.audit_name}</td>
                    <td>
                        <switch name="vo.is_review">
                            <case value="1">已审核</case>
                            <case value="-1">未审核</case>
                            <case value="-2">已拒绝</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="vo.is_shelves">
                            <case value="1">是</case>
                            <case value="-1">否</case>
                        </switch>
                    </td>
                    <td>
                        <if condition="checkAuth('Shops/insureProductById')">
                            <a href="{:U('Shops/insureProductById',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">详情</a>
                        </if>
                    </td>
                </tr>
            </volist>

            <!--交通-->
            <volist name="auditList['trafficList']" id="vo">
                <tr>
                    <td>{$vo.supplier_name}</td>
                    <td>交通</td>
                    <td>{$vo.supplier_sn}</td>
                    <td>{$vo.traffic_name}: 儿童价：{$vo.child_actual_cost}元/人<br>成人价：{$vo.adult_actual_cost}元/人 </td>
                    <td>{$vo.start_time|date="Y-m-d",###}至{$vo.end_time|date="Y-m-d",###}</td>
                    <td>{$vo.audit_name}</td>
                    <td>
                        <switch name="vo.is_review">
                            <case value="1">已审核</case>
                            <case value="-1">未审核</case>
                            <case value="-2">已拒绝</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="vo.is_shelves">
                            <case value="1">是</case>
                            <case value="-1">否</case>
                        </switch>
                    </td>
                    <td>
                        <if condition="checkAuth('Shops/trafficProductById')">
                            <a href="{:U('Shops/trafficProductById',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">详情</a>
                        </if>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>

</block>
<block name="js">
    <script src=""></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>

        //更改单品供应商状态
        function changeSupplierGoodsStatus(supplier_id,status) {
            $.ajax({
                type: 'POST',
                data: {supplier_id:supplier_id,status:status},
                url: '/index.php?m=Operator&c=Index&a=changeSupplierGoodsStatus',
                dataType: 'json',
                success: function (data) {
                    layer.msg(data.msg);
                    if (data.status==1) {
                        setTimeout(function(){
                            location.reload();
                        },1500);
                    }
                }
            });
        }

        //筛选显示
        $('body').on('change','.filtrate',function () {
            var id=$(this).val();
            if($(this).is(':checked')){
                $('.filtrate_'+id).show();
            }else{
                $('.filtrate_'+id).hide();
            }
        });


        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#start_time'
            });
            laydate.render({
                elem: '#end_time'
            });
        })

        /**
         *订单详情
         * @param orderId
         */

        function openDetail(orderId){
            layer.open({
                type: 2,
                offset:20,
                area: ['90%','90%'],
                title: '订单详情',
                content: '{:U("Orders/detail")}',
            })
        }
    </script>
</block>
